package com.springboot.cloud.demos.feign.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(name = "authorization-server", fallback = AuthorizeServiceFallback.class)
public interface AuthorizeService {

    @RequestMapping(method = RequestMethod.POST, value = "/oauth/token", headers = {"Content-Type: multipart/form-data", "Authorization=Basic dGVzdF9jbGllbnQ6dGVzdF9zZWNyZXQ="})
    Object authorize(@RequestBody MultiValueMap<String, String> map);

}
